
export default function (fn,timeout){
    var timerid = null;
    var that=this;
    var arg=arguments;
    return ()=>{
            if(timerid){
        clearTimeout(timerid);
        timerid=null;
    }
    timerid=setTimeout(()=>{
        fn.apply(that,arg);
    },timeout)
    }

}